import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import( '../components/common/Home.vue'),
            meta: { title: '系统框架' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import( '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                  path: '/rotation',
                  component: ()=> import('../components/page/Rotation'),
                  meta: {title: '轮播图设置'}
                },
                {
                    path: '/news',
                    component: ()=> import('../components/page/News'),
                    meta: {title: '新闻管理'}
                },
                {
                    path: '/notice',
                    component: ()=> import('../components/page/Notice'),
                    meta: {title: '公告管理'}
                },
                {
                    path: '/activity',
                    component: ()=> import('../components/page/Activity'),
                    meta: {title: '校友活动管理'}
                },
                {
                    path: '/about',
                    component: ()=> import('../components/page/About'),
                    meta: {title: '联系我们'}
                },
                {
                    path: '/alumniList',
                    component: ()=> import('../components/page/AlumniList'),
                    meta: {title: '校友信息列表'}
                },
                {
                    path: '/donationOnline',
                    component: ()=> import('../components/page/DonationOnline'),
                    meta: {title: '在线捐赠'}
                },
                {
                    path: '/donationOthers',
                    component: ()=> import('../components/page/DonationOthers'),
                    meta: {title: '其他方式捐赠'}
                },
                {
                    path: '/alumniUser',
                    component: ()=> import('../components/page/AlumniUser'),
                    meta: {title: '校友用户'}
                },
                {
                    path: '/adminUser',
                    component: ()=> import('../components/page/AdminUser'),
                    meta: {title: '管理员', permission: true}
                },
                {
                    path: '/messageInfo',
                    component: () => import( '../components/page/MessageInfo.vue'),
                    meta: { title: '消息通知' }
                },
                {
                    path: '/donationDetails',
                    component: () => import( '../components/page/DonationDetails.vue'),
                    meta: { title: '捐赠详情' }
                },
                {
                    path: '/alumniDetails',
                    component: () => import( '../components/page/AlumniDetails.vue'),
                    meta: { title: '校友信息详情' }
                },
                {
                    path: '/newsEdit',
                    component: () => import( '../components/page/NewsEdit.vue'),
                    meta: { title: '新闻编辑' }
                },
                {
                    path: '/newsDetails',
                    component: () => import( '../components/page/NewsDetails.vue'),
                    meta: { title: '新闻详情' }
                },
                {
                    path: '/noticeDetails',
                    component: () => import( '../components/page/NoticeDetails.vue'),
                    meta: { title: '公告详情' }
                },
                {
                    path: '/noticeEdit',
                    component: () => import( '../components/page/NoticeEdit.vue'),
                    meta: { title: '公告编辑' }
                },
                {
                    path: '/activityDetails',
                    component: () => import( '../components/page/ActivityDetails.vue'),
                    meta: { title: '校友活动详情' }
                },
                {
                    path: '/activityEdit',
                    component: () => import( '../components/page/ActivityEdit.vue'),
                    meta: { title: '校友活动编辑' }
                },
                {
                    path: '/404',
                    component: () => import( '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import( '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import( '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
